<?php
namespace API\Controller;
use Think\Controller;
class OrderController extends CommonController {
	//管理员进行发货操作
	// true表示载入成功 false失败
	//标识码 0表示失败 1表示成功
	public function shipment(){
		$Order = M("Orderlist");
		$orderid = I("post.orderid");
		$data = array(
			"status"=>1,
		);
		$res=$Order->where("id={$orderid}")->save($data);
		if (!$res) {
		             $this->response("发货操作",false,0,"发货失败");	
		}else{
			//删除相关信息
			$Message = M("Message");
			$Message->where("orderid ={$orderid}")->delete();
			$this->response("发货操作",true,1,"发货成功");
		}
	}
	
	//提醒用户评价商品
	public function Promptcomment(){
		$orderid = I("post.orderid");
		$Message = M("Message");
		$res=$Message->where("orderid ={$orderid}")->delete();
		
		$this->response("提醒用户评价",true,1,"提醒用户评价成功");
	}
	//恢复订单
	public function Recoveryorder(){
		$Order = M("Orderlist");
		$orderid = I("post.orderid");
		$data = array(
			"status" => 2
		);
		$res=$Order->where("id ={$orderid}")->save($data);
		if (!$res) {
		             $this->response("恢复订单",false,0,"恢复订单失败");	
		}else{
			$this->response("恢复订单",true,1,"恢复订单成功");
		}
	}
	
}